<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html lang="en">
<script type="text/javascript" src="/cooknote/resources/jquery.js"></script>


<script type="text/javascript">
$(document).ready(function() {
	$("#formbtn").click(function() {
		 $.ajax({
		        datatype:"json",
		        type: "POST",
		        url: "/cooknote/user_create",
		        data: $("#frmtest").serialize(),
		        success: function(response)
		        {
		            console.log(response);
		        },
		        error: function(e)
		        {
		            console.log('Error: ' + e);
		        }
		    });
	});
});

function go_list(){
	$('#frmtest').attr('method','GET')
	$('#frmtest').attr('action','/cooknote/user_list_form').submit();
}
</script>
<body>
<div class="container">

	<form id="frmtest" name="frmtest"  action="/cooknote/user_create">
			<input type="text" name="user_id" id="user_id" value="s11"/>
			<input type="text" name="nick_name" id="nick_name" value="captinkd"/>
			<input type="button" value="등록" id="formbtn">
	</form>

</div>

	<table>
			<tbody>
				<tr>
					<td>
						<a href="#" onclick="javascript:go_list();">리스트</a>
					</td>
				</tr>
			</tbody>
	</table>

</body>

</html>
